﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Sol_NetCoreDemo.Controllers
{
    //[Route("api/[controller]")]
    [Route("api/[controller]/{action}")]   //此处添加action   请求位置不用再填写一次方法
    [ApiController]
    public class DefaultController : ControllerBase
    {


        [HttpGet]
        public ActionResult<IEnumerable<string>> GGG()
        {
            return new string[] { "value1", "value2" };
        }


        [HttpGet]
        public IActionResult Feach()
        {
            List<object> users = new List<object>()
            {
                new  { Key = 1,Name = "胡彦斌", Age = 32,Address="西湖区湖底公园1号"},
                new  { Key = 2,Name = "胡彦斌", Age = 32,Address="西湖区湖底公园1号"},
                new  { Key = 3,Name = "胡彦斌", Age = 32,Address="西湖区湖底公园1号"},
                new   { Key = 4,Name = "胡彦斌", Age = 32,Address="西湖区湖底公园1号"},
                new   { Key = 5,Name = "胡彦斌", Age = 32,Address="西湖区湖底公园1号"},
                new   { Key = 6,Name = "胡彦斌", Age = 32,Address="西湖区湖底公园1号"},
                new   { Key = 7,Name = "胡彦斌", Age = 32,Address="西湖区湖底公园1号"},
                new   { Key = 8,Name = "胡彦斌", Age = 32,Address="西湖区湖底公园1号"},
                new   { Key = 9,Name = "胡彦斌", Age = 32,Address="西湖区湖底公园1号"},
                new   { Key = 10,Name = "胡彦斌", Age = 32,Address="西湖区湖底公园1号"}
            };

            return Ok(users);
        }

    }
}